import { AdColumn } from '@/components/AdTable';
import { useI18n } from '@/hooks/web/useI18n';
import { getMessageTypeEnumSchema } from '@/enums/messageTypeEnum';
import { getMessageLevelEnumSchema } from '@/enums/messageLevelEnum';
import { getMessageSendWayEnumSchema } from '@/enums/messageSendWayEnum';

const { t } = useI18n();
const messageTypeEnumSchema = getMessageTypeEnumSchema();
const messageLevelEnumSchema = getMessageLevelEnumSchema();
const messageSendWayEnumSchema = getMessageSendWayEnumSchema();

export const columns: AdColumn[] = [
  {
    title: t('entity.idTitle'),
    dataIndex: 'Id',
    filterable: true,
    dataType: 'integer',
  },
  {
    title: t('routes.system.message.methodText'),
    dataIndex: 'Method',
    dataType: 'string',
  },
  {
    title: t('routes.system.message.iconText'),
    dataIndex: 'Icon',
    filterable: false,
    dataType: 'string',
  },
  {
    title: t('routes.system.message.messageTypeText'),
    dataIndex: 'MessageType',
    filterable: true,
    dataType: 'enum',
    enumData: messageTypeEnumSchema,
  },
  {
    title: t('routes.system.message.messageLevelText'),
    dataIndex: 'MessageLevel',
    filterable: true,
    dataType: 'enum',
    enumData: messageLevelEnumSchema,
  },
  {
    title: t('routes.system.message.titleText'),
    dataIndex: 'Title',
    filterable: true,
    dataType: 'string',
  },
  {
    title: t('routes.system.message.contentText'),
    dataIndex: 'Content',
    filterable: true,
    dataType: 'string',
  },
  {
    title: t('routes.system.message.message.sendTimeText'),
    dataIndex: 'SendTime',
    filterable: true,
    dataType: 'datetime',
  },
  {
    title: t('routes.system.message.message.isSystemText'),
    dataIndex: 'IsSystem',
    filterable: true,
    dataType: 'boolean',
  },
  {
    title: t('routes.system.message.message.senderIdText'),
    dataIndex: 'SenderId',
    filterable: true,
    dataType: 'integer',
  },
  {
    title: t('routes.system.message.message.senderNameText'),
    dataIndex: 'SenderName',
    filterable: true,
    dataType: 'string',
  },
  {
    title: t('routes.system.message.message.senderNicknameText'),
    dataIndex: 'SenderNickname',
    filterable: true,
    dataType: 'string',
  },
  {
    title: t('routes.system.message.message.lastReadTimeText'),
    dataIndex: 'LastReadTime',
    filterable: true,
    dataType: 'datetime',
  },
  {
    title: t('routes.system.message.message.lastReadWayText'),
    dataIndex: 'LastReadWay',
    filterable: true,
    dataType: 'enum',
    enumData: messageSendWayEnumSchema,
  },
  {
    title: t('routes.system.message.isReadText'),
    dataIndex: 'IsRead',
    filterable: true,
    dataType: 'boolean',
  },
];
